//
//  HELPersonTableHeadView.m
//  sanda
//
//  Created by 陈武琦 on 16/7/11.
//  Copyright © 2016年 陈武琦. All rights reserved.
//

#import "HELPersonTableHeadView.h"

@implementation HELPersonTableHeadView


- (void)setBadge:(NSDictionary *)badge {

    _badge = badge;
    NSInteger compursolBadge = [_badge[@"sdUnRead"] integerValue];
    NSInteger examBadge = [_badge[@"examUnRead"] integerValue];
    if (compursolBadge > 0) {
        self.compursol.text = [NSString stringWithFormat:@"%ld",(long)compursolBadge];
        self.compursol.hidden = NO;
    }else {
    
        self.compursol.hidden = YES;
    
    }
   
    if (examBadge > 0) {
        self.exam.text = [NSString stringWithFormat:@"%ld",(long)examBadge];
        self.exam.hidden = NO;
    }else {
        
        self.exam.hidden = YES;
        
    }

}
//头像点击
- (IBAction)headBtnClick:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(headBtnClick)]) { // 如果协议响应了sendValue:方法
        [_delegate headBtnClick]; // 通知执行协议方法
    }
}
//必修 点击
- (IBAction)compulsoryBtnClick:(UIButton *)sender {

    if ([_delegate respondsToSelector:@selector(headviewDidSelect:)]) { // 如果协议响应了sendValue:方法
        [_delegate headviewDidSelect:1]; // 通知执行协议方法
    }
}
//选修点击
- (IBAction)electBtnClick:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(headviewDidSelect:)]) { // 如果协议响应了sendValue:方法
        [_delegate headviewDidSelect:2]; // 通知执行协议方法
    }
}
//考试点击
- (IBAction)examBtnClick:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(headviewDidSelect:)]) { // 如果协议响应了sendValue:方法
        [_delegate headviewDidSelect:3]; // 通知执行协议方法
    }
}

@end
